{% extends "base.html" %}
{% load i18n %}
{% load account %}

{% block title %}{% trans "确认电子邮件地址" %}{% endblock %}

{% block content %}
<div class="container py-5">
  <div class="row justify-content-center">
    <div class="col-md-6">
      <div class="card shadow">
        <div class="card-header bg-primary text-white">
          <h1 class="h4 mb-0">{% trans "确认电子邮件地址" %}</h1>
        </div>
        <div class="card-body">
          {% if confirmation %}
            {% user_display confirmation.email_address.user as user_display %}
            <p>{% blocktrans with confirmation.email_address.email as email %}请确认 <a href="mailto:{{ email }}">{{ email }}</a> 是用户 {{ user_display }} 的电子邮件地址。{% endblocktrans %}</p>

            <form method="post" action="{% url 'account_confirm_email' confirmation.key %}">
              {% csrf_token %}
              <button class="btn btn-primary w-100" type="submit">{% trans '确认' %}</button>
            </form>
          {% else %}
            {% url 'account_email' as email_url %}
            <p>{% blocktrans %}此确认链接已过期或无效。请<a href="{{ email_url }}">发送新的确认电子邮件</a>。{% endblocktrans %}</p>
          {% endif %}
        </div>
      </div>
    </div>
  </div>
</div>
{% endblock %}

